#include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
 
int main(int argc, char **argv)
{
    //read a yaml file
    cv::FileStorage fs_read("./test.yaml", cv::FileStorage::READ);
 
    std::string time;
    //second method:use FileNode::operator >>
    fs_read["Time"] >> time;
 
    std::vector<int> image_size;
    fs_read["imageSize"] >> image_size;
 
    cv::Mat camera_matrix, distort_coefficient;
    fs_read["cameraMatrix"] >> camera_matrix;
    fs_read["distCoeffs"] >> distort_coefficient;
 
    std::cout << "Time: " << time << std::endl
              << "cameraMatrix: " << camera_matrix << std::endl
              << "distCoeffs: " << distort_coefficient << std::endl;
 
    fs_read.release();
 
    return 0;
}